package com.gzhuxj201.mapper;

import com.gzhuxj201.entity.StuFile;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface StuFileMapper {

    List<StuFile> page(String tno, Integer homeWorkId, String sno, String studentName);

    @Select("select  * from stuFile where homeWorkId=#{homeWorkId} and sno=#{sno}")
    StuFile selectByHomeWorkIdAndSno(Integer homeWorkId, String sno);

    @Delete("delete from stuFile where homeWorkId=#{homeWorkId} and sno=#{sno}")
    int deleteByHomeWorkAndSno(Integer homeWorkId, String sno);

    @Insert("insert into stuFile values(#{homeWorkId},#{sno},#{studentName},#{name},#{newName},#{courseId})")
    int add(StuFile stuFile);

}
